package com.sunducation.wts.emoji

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.core.content.ContextCompat.getSystemService
import android.icu.lang.UCharacter.GraphemeClusterBreak.T
import com.vdurmont.emoji.EmojiParser
import androidx.core.content.ContextCompat.getSystemService
import android.icu.lang.UCharacter.GraphemeClusterBreak.T
import androidx.core.content.ContextCompat.getSystemService
import android.icu.lang.UCharacter.GraphemeClusterBreak.T
import com.vdurmont.emoji.EmojiParser.FitzpatrickAction
import androidx.core.content.ContextCompat.getSystemService
import android.icu.lang.UCharacter.GraphemeClusterBreak.T
import androidx.core.content.ContextCompat.getSystemService
import android.icu.lang.UCharacter.GraphemeClusterBreak.T
import androidx.core.content.ContextCompat.getSystemService
import android.icu.lang.UCharacter.GraphemeClusterBreak.T
import android.widget.TextView
import androidx.emoji.text.EmojiCompat


class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        val tv : TextView = findViewById<TextView>(R.id.tv_color);

        var str = "An :grinning:awesome :smiley:string &#128516;with a few :wink:emojis!"
        var result = EmojiParser.parseToUnicode(str)

        str = "\r\nAn 😀awesome 😃string with a few 😉emojis!"
        result = result + EmojiParser.parseToAliases(str)

        str = "\r\nHere is a boy: \uD83D\uDC66\uD83C\uDFFF!"
        result = result + EmojiParser.parseToAliases(str)
        result = result + EmojiParser.parseToAliases(str, FitzpatrickAction.PARSE)
        result = result + EmojiParser.parseToAliases(str, FitzpatrickAction.REMOVE)
        result = result + EmojiParser.parseToAliases(str, FitzpatrickAction.IGNORE)

        str = "\r\nAn 😀awesome 😃string with a few 😉emojis!"

        result = result + EmojiParser.parseToHtmlDecimal(str)


        result = result + EmojiParser.parseToHtmlHexadecimal(str)


        str = "\r\nHere is a boy: \uD83D\uDC66\uD83C\uDFFF!"
        result = result + EmojiParser.parseToHtmlDecimal(str)
        result = result + EmojiParser.parseToHtmlDecimal(str, FitzpatrickAction.PARSE)
        result = result + EmojiParser.parseToHtmlDecimal(str, FitzpatrickAction.REMOVE)
        result = result + EmojiParser.parseToHtmlDecimal(str, FitzpatrickAction.IGNORE)

        tv.text = result;
        
    }
}
